<%@page import="com.baozun.model.TUser"%>
<%@page import="com.baozun.util.PageData"%>
<%@page import="com.baozun.util.CommonConst"%>
<%@page import="java.util.List"%>
<%@page import="com.baozun.model.TContact"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Static &amp; Dynamic Tables" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="../assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!-- page specific plugin styles -->

<link rel="stylesheet"
	href="../assets/css/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" href="../assets/css/chosen.css" />
<link rel="stylesheet" href="../assets/css/colorpicker.css" />

<!-- fonts -->

<link rel="stylesheet" href="../assets/css/font.css" />

<!-- ace styles -->

<link rel="stylesheet" href="../assets/css/ace.min.css" />
<link rel="stylesheet" href="../assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="../assets/css/ace-skins.min.css" />
<link rel="stylesheet" href="../css/style.css"/>
<style type="text/css">
html {
	width: 100%;
	height: 100%;
	background: #fff;
}

body {
	background: #fff;
}
.modal_box {
	width: 100%;
	height: auto;
	min-height: 260px;
	margin: 0 auto;
	padding: 20px 0 10px 0;
}
.modal_btn {
	margin-top: 20px;
}

.modal_btn a {
	margin: 0 10px;
}
</style>
</head>
<body>
	<div class="row">
		<div class="col-xs-12">
			<form class="form-inline" id="password_edit_form" name="password_edit_form" method="post" target="detail">
				<div class="modal_box" style="min-height:160px;">
				<dl class="tc_text">
					<dt>新密码(<font color="red">*</font>)</dt>
					<dd><input type="password" class="text_sm" name="<%=TUser.ST_PASSWORD%>" id="stPassword" value="" onkeydown="enterJump(event,'confirmPassword')"/></dd>
				</dl>
				<dl class="tc_text">
					<dt>确认密码</dt>
					<dd><input type="password" class="text_sm" name="confirmPassword" id="confirmPassword" value="" onkeydown="enterJump(event,'password_edit_form')"/></dd>
				</dl>
				<p class="modal_btn">
					<a href="javascript:;" class="btn btn-primary btn_bs"
						onclick="passwordEdit()">保 存</a>
					<a href="javascript:closeWindow()" class="btn">取 消</a>
				</p>
			</div>
			</form>
			<!-- 关键点1 -->
		<iframe name="detail" style="width: 100%; height:200px; display: none"></iframe>
		</div>
	</div>
	<script src="../assets/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="../js/artDialog/artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../js/artDialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../js/openDialog.js"></script>
	<script type="text/javascript" src="../js/openDialogcustom.js"></script>
	<script>
	//检查是否为空，如果为空返回假，有值返回真,提示信息为message
	function checkEmpty(id,message){
		var value = $("#"+id).val();
		if(value == null || "" == value){
			alert(message);
			return false;
		}else{
			return true;
		}
	}
	function checkConfirm(){
		if($("#confirmPassword").val() != $("#stPassword").val()){
			alert("确认密码不一致");
			return false;
		}else{
			return true;
		}
	}
	function passwordEdit(){
		if(checkEmpty("stPassword", "密码不能为空")
				&&checkEmpty("confirmPassword", "确认密码不能为空")
				&&checkConfirm()){
			document.password_edit_form.action="password_edit_submit.do";
			document.password_edit_form.submit();
		}
	}
	
	//提交返回操作
	function workLater() {
		closeWindow(); // 必须写在“art.dialog.opener.querypross();”之前
		art.dialog.opener.process();
	}
	
	//按下enter键后跳到下一个输入框,输入完成后提交,如果得到的id是form，那么该form进行提交
	function enterJump(event,id){
		//如果是按下回车键
		if(event.keyCode == 13){
			//先判断id得到的是输入框还是form
			var obj = $("#"+id);
			var tagName = obj.prop("tagName");//注意这里不能使用attr，使用attr将会是undifined
			if(tagName == "INPUT"){
				obj.focus();//输入框进入该输入框
			}else{
				obj.submit();
			}
		}
	}
	</script>
</body>
</html>